package com.xayy.health.mgt.model;

import cn.kawins.base.utils.annotation.SpinnerKey;
import cn.kawins.base.utils.annotation.SpinnerValue;
import cn.kawins.mybatis.base.BaseModel;
import cn.kawins.spring.mvc.validator.Group;
import io.swagger.annotations.ApiModelProperty;
import lombok.*;
import tk.mybatis.mapper.annotation.KeySql;
import tk.mybatis.mapper.code.IdentityDialect;

import javax.persistence.Id;
import javax.persistence.Table;
import javax.validation.constraints.NotNull;
import java.util.Date;

/**
 * @author Nie
 * @version V1.0
 * @date 2023/4/11 13:54
 */
@Data
@Builder
@AllArgsConstructor
@NoArgsConstructor
@EqualsAndHashCode(callSuper = true)
@Table(name = "HEALTH.fraction_interval_score")
public class FractionIntervalScore extends BaseModel<Long> {
    /**
     * 主键
     */
    @Id
    @KeySql(dialect = IdentityDialect.MYSQL)
    @NotNull(groups = Group.Update.class, message = "主键不能为空")
    @ApiModelProperty(value = "主键")
    private Long id;

    /**
     * 分值类型
     */
    @ApiModelProperty(value = "分值类型")
    private Integer fractionType;

    /**
     * 开始分数
     */
    @ApiModelProperty(value = "开始分数")
    private Integer startScore;

    /**
     * 结束分数
     */
    @ApiModelProperty(value = "结束分数")
    private Integer endScore;

    /**
     * 分值名称
     */
    @ApiModelProperty(value = "分值名称")
    @SpinnerValue("msg")
    private String fractionName;

    /**
     * 等级
     */
    @ApiModelProperty(value = "等级")
    @SpinnerKey("code")
    private Integer level;

    /**
     * 节点颜色
     */
    @ApiModelProperty(value = "节点颜色")
    private String color;
    /**
     * 创建人
     */
    @ApiModelProperty(value = "创建人")
    private String createdBy;

    /**
     * 创建时间
     */
    @ApiModelProperty(value = "创建时间")
    private Date createdTime;

    /**
     * 更新人
     */
    @ApiModelProperty(value = "更新人")
    private String updatedBy;

    /**
     * 更新时间
     */
    @ApiModelProperty(value = "更新时间")
    private Date updatedTime;

    @Override
    public Long idValue() {
        return id;
    }
}
